home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus Leser 19
/
Amiga Plus Leser CD 19.iso
/
Online
/
AmigaTalk
/
intuition
/
Boopsi.st
< prev
next >
Wrap
Text File
|
2002-05-05
|
7KB
|
172 lines
" -------------------------------------------------------------------- "
" The Boopsi Class implements the AmigaTalk to BOOPSI functions. "
" I'm NOT going to document how existing BOOPSI classes are imple- "
" mented, you'll have to find that information from someone else! "
""
" See BOOPSIComms.st & BOOPSIMethodIDs.st for special tags used by the "
" BOOPSI system & look at BoopsiClassNames.st "
" -------------------------------------------------------------------- "
Class Boopsi :Object ! private rastPortObj iclassObj !
[
dispose
" You eventually free the object using this method: "
<primitive 238 0 private>.
private <- nil.
^ nil
|
newBoopsiObject: classIDString in: iclassObject tags: tagArray
" This is the general method of creating objects from 'boopsi' classes.
* ('Boopsi' stands for basic object-oriented programming system for
* Intuition.)
*
* You specify a class either as iclassObject (for a private class) or
* by its ID string (for public classes). If iclassObject is nil,
* then the classID is used. (See BoopsiClassNames.st)
*
* You further specify initial 'create-time' attributes for the
* object via a TagItem list, and they are applied to the resulting
* generic data object that is returned. The attributes, their meanings,
* attributes applied only at create-time, and required attributes
* are all defined and documented on a class-by-class basis.
*
* RETURNS
* A boopsi object, which may be used in different contexts such
* as a gadget or image, and may be manipulated by generic functions.
* You eventually free the object using the dispose method.
"
^ private <- <primitive 238 1 iclassObject classIDString tagArray>
|
xxxAddBoopsiClass
" You don't need to call this method, makeBoopsiClass:for:id:size:flags:
* will take care of it for you!
"
<primitive 238 2 iclassObj>
|
removeBoopsiClass
" Makes a public class unavailable for public consumption.
* It's OK to call this function for a class which is not
* yet in the internal public class list, or has been
* already removed.
"
<primitive 238 3 iclassObj>
|
freeBoopsiClass ! success !
success <- <primitive 238 4 iclassObj>.
iclassObj <- nil. " Too late! It's all gone! "
^ success " Returns true if successful "
|
makeBoopsiClass: classID for: superClassObj id: superClassID size: size flags: flags
" Make your own BOOPSI Class. classID & superClassID can be nil,
* (which indicates a private BOOPSI Class). superClassObj
* should NEVER be nil. size is the size of the instance data
* that your class's objects will require, beyond that data defined
* for your superclass's objects. flags should be zero for now
* (unless you KNOW otherwise):
"
iclassObj <- <primitive 238 5 classID superClassID superClassObj size flags>.
self xxxAddBoopsiClass.
^ iclassObj
|
obtainGIRPort: gadgetInfoObject
" Sets up a RastPort for use (only) by custom gadget hook routines.
* This function must be called EACH time a hook routine needing
* to perform gadget rendering is called, and must be accompanied
* by a corresponding call to releaseGIRPort.
*
* Note that if a hook function passes you a RastPort pointer,
* e.g., GM_RENDER, you needn't call obtainGIRPort in that case.
"
^ rastPortObj <- <primitive 238 6 gadgetInfoObject>
|
releaseGIRPort
" Release a custom gadget RastPort Object from obtainGIRPort: "
<primitive 238 7 rastPortObj>
|
getAttribute: attrID from: object into: storageObj
^ <primitive 238 8 attrID object storageObj>
|
setAttributes: anObject tags: tagArray
" Specifies a set of attribute/value pairs with meaning as
* defined by a 'boopsi' object's class.
*
* This function does not provide enough context information or
* arbitration for boopsi gadgets which are attached to windows
* or requesters. For those objects, use setGadgetAttributes:from:req:tags:
*
* The object does whatever it wants with the attributes you provide.
* The return value tends to be non-zero if the changes would require
* refreshing gadget imagery, if the object is a gadget.
"
^ <primitive 238 9 anObject tagArray>
|
setGadgetAttributes: gadObj from: winObj req: reqObj tags: tagArray
" Same as setAttributes:tags:, but provides context information and
* arbitration for classes which implement custom Intuition gadgets.
*
* You should use this function for boopsi gadget objects which have
* already been added to a requester or a window, or for 'models' which
* propagate information to gadget(s) already added.
*
* Typically, the gadgets will refresh their visuals to reflect
* changes to visible attributes, such as the value of a slider,
* the text in a string-type gadget, the selected state of a button.
*
* You can use this as a replacement for setAttributes:tags:, too,
* if you specify nil for the 'winObj' and 'reqObj' parameters.
*
* The return value tends to be non-zero if the changes would require
* refreshing gadget imagery, if the object is a gadget.
"
^ <primitive 238 10 gadObj winObj reqObj tagArray>
|
nextObject: fromObject
" This function is for boopsi class implementors only.
*
* When you collect a set of boopsi objects on an Exec List
* structure by invoking their OM_ADDMEMBER method, you
* can (only) retrieve them by iterations of this method.
*
* Works even if you remove and dispose the returned list
* members in turn.
"
^ <primitive 238 11 fromObject>
|
doGadgetMethod: gadObj from: winObj req: reqObj message: msgObj
" Same as the DoMethod() function of amiga.lib, but provides context
* information and arbitration for classes which implement custom
* Intuition gadgets.
*
* You should use this method for boopsi gadget objects,
* or for 'models' which propagate information to gadgets.
*
* The object does whatever it wants with the message you sent,
* which might include updating its gadget visuals.
*
* The return value is defined per-method.
"
^ <primitive 238 12 gadObj winObj reqObj msgObj>
|
translateBoopsiErrorNumber
^ <primitive 238 13>
|
doSuperMethod: onObject message: msgObj
" Do NOT know if this is needed, but it is included to
* complete the functionality of the Class:
"
^ <primitive 238 14 iclassObj onObject msgObj>
|
coerceMethod: onObject message: msgObj
" Do NOT know if this is needed, but it is included to
* complete the functionality of the Class:
"
^ <primitive 238 15 iclassObj onObject msgObj>
]